﻿/***********************************************************************
 * <copyright file="VendorEntity.cs" company="BUCA JSC">
 * -->    Copyright (C) statement. All right reserved
 * </copyright>
 * 
 * Created:   Hoàng Bích Sơn
 * Email:    sonhb@buca.vn
 * Website:
 * Create Date: Friday, March 7, 2014
 * Usage: 
 * 
 * RevisionHistory: 
 * Date         Author               Description 
 * 
 * ************************************************************************/

using BusinessObjects;
using BusinessObjects.BusinessRules;


namespace BusinessObjects.BussinessDictionary
{
    /// <summary>
    /// VendorEntity class
    /// </summary>
    public class Vendor : BusinessObject
    {

        /// <summary>
        /// Initializes a new instance of the <see cref="VendorEntity"/> class.
        /// </summary>
        public Vendor()
        {
            AddRule(new ValidateId("VendorId"));
            AddRule(new ValidateRequired("Code"));
            AddRule(new ValidateLength("Name", 1, 50));
        }


        public Vendor(long vendorId, string code, string name, string address, string contactName,  string phone,
            string fax, string description,
            long unitId, bool isActive) 
            :this()
        {
            VendorId = vendorId;
            Code = code;
            Name = name;
            Address = address;
            ContactName = contactName;
            PhoneNumber = phone;
            Description = description;
            Fax = fax;
            IsActive = isActive;
            UnitId = unitId;
        }

        /// <summary>
        /// Gets or sets the cus identifier.
        /// </summary>
        /// <value>
        /// The cus identifier.
        /// </value>
        public long VendorId { get; set; }

        /// <summary>
        /// Gets or sets the code.
        /// </summary>
        /// <value>
        /// The code.
        /// </value>
        public string Code { get; set; }

        /// <summary>
        /// Gets or sets the full name.
        /// </summary>
        /// <value>
        /// The full name.
        /// </value>
        public string Name { get; set; } 

        /// <summary>
        /// Gets or sets the address.
        /// </summary>
        /// <value>
        /// The address.
        /// </value>
        public string Address { get; set; }

        /// <summary>
        /// Gets or sets the name of the contact.
        /// </summary>
        /// <value>
        /// The name of the contact.
        /// </value>
        public string ContactName { get; set; }

        

        /// <summary>
        /// Gets or sets the phone.
        /// </summary>
        /// <value>
        /// The phone.
        /// </value>
        public string PhoneNumber { get; set; } 

        /// <summary>
        /// Gets or sets the fax.
        /// </summary>
        /// <value>
        /// The fax.
        /// </value>
        public string Fax { get; set; }

        /// <summary>
        /// Gets or sets the description.
        /// </summary>
        /// <value>
        /// The description.
        /// </value>
        public string Description { get; set; }

  
        /// <summary>
        /// Gets or sets a value indicating whether [is active].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [is active]; otherwise, <c>false</c>.
        /// </value>
        public bool IsActive { get; set; }

        /// <summary>
        /// Gets or sets the stock identifier.
        /// </summary>
        /// <value>The stock identifier.</value>
        public long UnitId { get; set; } 
    }
}
